home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / flight-of-the-museum.swf / scripts / engine / levelData / Level_02.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  3.1 KB  |  96 lines

  1. package engine.levelData
  2. {
  3.    import copy.CopyBank;
  4.    import engine.WorldScene;
  5.    import engine.dynamicObjects.*;
  6.    
  7.    public class Level_02 extends LevelData
  8.    {
  9.        
  10.       
  11.       public function Level_02()
  12.       {
  13.          super();
  14.          _goalParameters = new Array();
  15.       }
  16.       
  17.       override public function buildLevel() : *
  18.       {
  19.          var i:* = undefined;
  20.          var fuelIcon:* = undefined;
  21.          var goalObj:Object = null;
  22.          var missionObj:Object = null;
  23.          var rNum:* = undefined;
  24.          var podium:* = undefined;
  25.          var cage:* = undefined;
  26.          super.buildLevel();
  27.          for(i = 0; i < 5; i++)
  28.          {
  29.             rNum = Math.random();
  30.             if(rNum < 0.3)
  31.             {
  32.                podium = new Podium("tall");
  33.                podium.x = 2200 + Math.random() * 150 + i * 300;
  34.                podium.y = 700;
  35.                WorldScene.Instance.GameplayObjects.push(podium);
  36.                cage = new Cage1();
  37.                cage.x = podium.x;
  38.                cage.y = 568;
  39.                WorldScene.Instance.GameplayObjects.push(cage);
  40.                WorldScene.Instance.Cages.push(cage);
  41.             }
  42.             if(rNum >= 0.3 && rNum < 0.6)
  43.             {
  44.                podium = new Podium("med");
  45.                podium.x = 2200 + Math.random() * 150 + i * 300;
  46.                podium.y = 700;
  47.                WorldScene.Instance.GameplayObjects.push(podium);
  48.                cage = new Cage1();
  49.                cage.x = podium.x;
  50.                cage.y = 582;
  51.                WorldScene.Instance.GameplayObjects.push(cage);
  52.                WorldScene.Instance.Cages.push(cage);
  53.             }
  54.             if(rNum >= 0.6)
  55.             {
  56.                podium = new Podium("short");
  57.                podium.x = 2200 + Math.random() * 150 + i * 300;
  58.                podium.y = 700;
  59.                WorldScene.Instance.GameplayObjects.push(podium);
  60.                cage = new Cage1();
  61.                cage.x = podium.x;
  62.                cage.y = 604;
  63.                WorldScene.Instance.GameplayObjects.push(cage);
  64.                WorldScene.Instance.Cages.push(cage);
  65.             }
  66.          }
  67.          fuelIcon = new FuelIcon();
  68.          fuelIcon.x = 50;
  69.          fuelIcon.y = 1500;
  70.          WorldScene.Instance.GameplayObjects.push(fuelIcon);
  71.          fuelIcon = new FuelIcon();
  72.          fuelIcon.x = 2500;
  73.          fuelIcon.y = 1500;
  74.          WorldScene.Instance.GameplayObjects.push(fuelIcon);
  75.          _missionDescription = CopyBank.Instance.MissionDesc_Cages;
  76.          goalObj = {
  77.             "Type":"Cage",
  78.             "Count":5
  79.          };
  80.          _goalParameters.push(goalObj);
  81.          missionObj = {
  82.             "Description":_missionDescription,
  83.             "BoundsX":_missionBoundsX,
  84.             "BoundsHint":_missionBoundsHint,
  85.             "GoalParamaters":_goalParameters,
  86.             "PrimaryGoalType":"Cages",
  87.             "StartLoc":{
  88.                "x":5000,
  89.                "y":400
  90.             }
  91.          };
  92.          WorldScene.Instance.setMissionDetails(missionObj);
  93.       }
  94.    }
  95. }
  96.